<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>

        <!-- blueprint CSS framework -->
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
        <!--[if lt IE 8]>
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
        <![endif]-->
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/main.css" />


        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/layout-default-latest.css" />
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/jquery.scrollpane.css" />


        <style type="text/css">
            html, body {
                background:	#666;
                width:		100%;
                height:		100%;					
                padding:	0;
                margin:		0;
                overflow:	auto; /* when page gets too small */
            }
            #container {
                /*                background:	#999;
                                height:		95%;
                                margin:		0 auto;
                                width:		100%;
                                max-width:	900px;
                                min-width:	700px;
                                _width:		700px;  min-width for IE6 

                                margin-top: 5px;
                                margin-bottom: 5px;
                                background: white;
                                border: 1px solid #121c28;*/
                border: medium none;
                height: 100%;
                margin: 0;
                overflow: hidden;
                padding: 0;
                position: relative;
            }

            .pane {
                display:	none; /* will appear when layout inits */
                background:     #D5EADE;
            }

        </style>


        <style type="text/css">

            h3 ,
            p.footer {
                font-size:		1.2em;
                background:		#F6F6F6;
                border-bottom:	1px solid #BBB;
                padding:		5px 15px;
                margin:			0;
            }
            p.footer {
                font-size:		1em;
                border-top:		1px solid #BBB;
                border-bottom:	0;
            }
        </style>
        
        <STYLE>
            .ui-widget, .ui-widget-header { font-family: Tahoma, Verdana, Arial, sans-serif; font-size: 12px; }
            .ui-layout-center { margin-top: 1em; }
            .ui-layout-center li .ui-icon-close { float: left; margin: 0.4em 0.2em 0 0; cursor: pointer; }

            /*            .ui-layout-toggler {
                            display: none !important;
                            width: 1px !important;
                        }            
            
                        .ui-layout-resizer {
                            background-color: #666 !important;
                            width: 1px !important;
                            margin: 0px !important;
                            padding: 0px !important;
                        }          
                        
                        .ui-layout-resizer-open{
                            width: 1px !important;
                            margin: 0px !important;
                            padding: 0px !important;
                            
                        }*/

            .ui-layout-pane{
                border: 1px groove #4297d7!important;
            }
            .ui-layout-south{
                border: none!important;
                padding: 0!important;
                /*                padding: 0px!important;
                                margin: 0px!important;
                                display: block!important;
                                position: absolute!important;
                                overflow: auto!important;*/
            }
            .ui-layout-resizer-south {
                /*                background-color: green !important;*/
            }          
            .ui-layout-toggler{
                background-color: #2191c0 !important;
                /*                height: 1px!important;*/
            }          
            .ui-layout-resizer {
                background-color: #2191c0 !important;
                /*                height: 1px!important;*/
            }          
            .ui-layout-toggler-south {
                /*                display: none !important;*/
            }        
            .ui-layout-resizer-south-open{
                /*                display: none !important;                */
            }
            .ui-layout-toggler{
                margin: 0px!important;
                /*                padding: 0px!important;*/
            }

        </STYLE>
        

        <?php Yii::app()->clientScript->registerCoreScript('jquery') ?>                
        <?php Yii::app()->getClientScript()->registerCoreScript('jquery.ui'); ?>

        <?php
        Yii::app()->clientScript->registerCssFile(
                Yii::app()->assetManager->publish(
                        Yii::app()->basePath . '/vendors/jquery.ui/start/'
                ) .
                '/jquery.ui.all.css', 'screen'
        );
        ?>
<!--	<script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery-latest.js"></script>-->
<!--        <script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery-ui-latest.js"></script>-->
        <script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery.layout-latest.js"></script>
        <script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery.mousewheel.js"></script>
<!--        <script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery.scrollpane.js"></script>-->
        <script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/debug.js"></script>
<!--        <script type="text/javascript" src="<?php echo Yii::app()->theme->baseUrl; ?>/js/jquery.ba-resize.min.js"></script>-->

        <script type="text/javascript">

            var myLayout	;

            $(document).ready(function () {

                myLayout = $('#container').layout({
                    //	need to re-init the scrollbar whenever the pane resizes
//                    center__onresize:                           initPaneScrollbar
//                    ,	west__onresize:				initPaneScrollbar
//                    ,	east__onresize:				initPaneScrollbar
                    //	timing issue, so init scrolling AFTER init done (below)
//                    ,	triggerEventsOnLoad:		false
//                    //	live-resizing on all panes - not required
//                    ,	resizeWhileDragging:		true
//                    //	avoid re-initing scrollbars repeatedly while: resizeWhileDragging
//                    //	sizing is much smoother, but scrollbar.height and text-width don't update until 'done'
//                    ,	triggerEventsWhileDragging:	false
//                    // enable state-managment for pane-size
//                    ,	useStateCookie:				false
//                    ,   north__spacing_open:	1                    
                    //                    ,   north__size: 50
//                    ,   west__size: 250
//                    ,   west__resizable: false
//                    ,   north__resizable: false
                    defaults:{
                            spacing_open:  0
                        },
                        north: {
                            size: 50
                        }            
                    });
                myLayout.sizePane("south", 28);
                myLayout.sizePane("south", 29);
                myLayout.sizePane("north", 75);
                myLayout.sizePane("west", 250);

            });
        </script>

    </head>

    <body>
        <div id="container">

            <!--            <div class="ui-layout-north" onmouseover="myLayout.allowOverflow('north')" onmouseout="myLayout.resetOverflow(this)">-->
            <div class="ui-layout-north ui-state-default" onmouseover="myLayout.allowOverflow(this)"  onmouseout="myLayout.allowOverflow(this)">
                <div id="" style="width: 75%;position: absolute;">
                    <?php
                    $this->widget('ext.CPotatoMenu.CPotatoMenu', array(
                        'style' => 'default', // or default or navbar
                        'items' => array(
                            array('label' => 'Home', 'url' => array('/site/index')),
                            array('label' => Yii::t('ui', 'Configuration'), 'submenuOptions' => array('id' => 'myId'), 'visible' => Yii::app()->getModule('user')->isAdmin(), 'items' => array(
                                    array('label' => Yii::t('application', 'General Accounting'), 'url' => array('/site/page&view=generalaccounting')),
                                    array('label' => Yii::t('application', 'Central Configuration'), 'url' => array('/site/page&view=centralconfiguration')),
                                    array('label' => Yii::t('application', 'Property'), 'url' => array('/site/page&view=property')),
                                    array('label' => Yii::t('application', 'Water'), 'url' => array('/site/page&view=water')),
                                    array('label' => Yii::t('application', 'Building Permission'), 'url' => array('/site/page&view=buildingpermission')),
                                    array('label' => Yii::t('application', 'Birth And Death'), 'url' => array('/site/page&view=birthanddeath')),
                                    array('label' => Yii::t('application', 'License Permission'), 'url' => array('/site/page&view=licensepermission')),
                                    array('label' => Yii::t('application', 'Ration Card'), 'url' => array('/site/page&view=rashancard')),
                                    array('label' => Yii::t('application', 'Central Purchase'), 'url' => array('/site/page&view=centralpurchase')),
                                    array('label' => Yii::t('application', 'Rental Property'), 'url' => array('/site/page&view=rentalproperty')),
                                    array('label' => Yii::t('application', 'Human Resource '), 'url' => array('/site/page&view=humanresource')),
                                    array('label' => Yii::t('application', 'Store And Workshop'), 'url' => array('/site/page&view=storeandworkshop')),
                                    array('label' => Yii::t('application', 'Social Security '), 'url' => array('/site/page&view=socialsecurity')),
                            )),
                            array('label' => Yii::t('ui', 'Transaction'), 'submenuOptions' => array('id' => 'myId'), 'visible' => Yii::app()->getModule('user')->isAdmin(), 'items' => array(
                                    array('label' => Yii::t('application', 'Accounting'), 'url' => array('/site/page&view=accounting')),
                                    array('label' => Yii::t('application', 'Property'), 'url' => array('/site/page&view=propertytransaction')),
                                    array('label' => Yii::t('application', 'Water'), 'url' => array('/site/page&view=watertransaction')),
                                    array('label' => Yii::t('application', 'Building Permision'), 'url' => array('/site/page&view=buildingpermission')),
                                    array('label' => Yii::t('application', 'Birth And Death'), 'url' => array('/site/page&view=birth')),
                                    array('label' => Yii::t('application', 'License Permission'), 'url' => array('/site/page&view=licensepermission')),
                                    array('label' => Yii::t('application', 'Ration Card'), 'url' => array('/site/page&view=rashancard')),
                                    array('label' => Yii::t('application', 'Central Purchase'), 'url' => array('/site/page&view=centralpurchase')),
                                    array('label' => Yii::t('application', 'Rental Property'), 'url' => array('/site/page&view=rentalproperty')),
                                    array('label' => Yii::t('application', 'Human Resource '), 'url' => array('/site/page&view=humanresource')),
                                    array('label' => Yii::t('application', 'Store And Workshop'), 'url' => array('/site/page&view=storeandworkshop')),
                                    array('label' => Yii::t('application', 'Social Security '), 'url' => array('/site/page&view=socialsecurity')),
//                                    array('label'=>'Stock Transfer', 'url'=>array('/stocktransfer/admin')),
                            )),
//                            array('label' => 'Book', 'url' => array('/yiiBook'), 'visible' => !Yii::app()->user->isGuest),
//                            array('url' => Yii::app()->getModule('user')->registrationUrl, 'label' => Yii::app()->getModule('user')->t("Register"), 'visible' => Yii::app()->user->isGuest),
                            array('label' => Yii::t('ui', 'Report'), 'submenuOptions' => array('id' => 'myId'), 'visible' => Yii::app()->getModule('user')->isAdmin(), 'items' => array(
                                    array('label' => Yii::t('application', 'General Accounting'), 'url' => array('/site/page&view=generalaccountingreport')),
                                    array('label' => Yii::t('application', 'Property Report'), 'url' => array('/site/page&view=propertyreport')),
                                    array('label' => Yii::t('application', 'Water Report'), 'url' => array('/site/page&view=waterreport')),
                            )),
                            array('label' => Yii::t('ui', 'Admin CP'), 'submenuOptions' => array('id' => 'myId'), 'visible' => Yii::app()->getModule('user')->isAdmin(), 'items' => array(
                                    array('label' => Yii::t('application', 'User Management'), 'url' => array('/user/admin')),
                                    array('label' => Yii::t('application', 'Audit'), 'url' => array('/auditTrail/admin')),
                            )),
                            array('url' => Yii::app()->getModule('user')->loginUrl, 'label' => Yii::app()->getModule('user')->t("Login"), 'visible' => Yii::app()->user->isGuest),
                            array('url' => Yii::app()->getModule('user')->logoutUrl, 'label' => Yii::app()->getModule('user')->t("Logout") . ' (' . Yii::app()->user->name . ')', 'visible' => !Yii::app()->user->isGuest),
//				array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
//				array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
                        ),
                            )
                    );
                    ?>

                </div>
                <div style="text-align: right; padding-top: 5px;color: white;" >
                    <span><?php echo '<b>' . Yii::t('application', 'Financial Year: ') . '</b><u>' . Yii::app()->session['ccfyear']->fyear . '</u>'; ?></span>
                </div>

            </div>

            <?php echo $content; ?>

        </div>
    </body>
</html>
